package com.pine.service.util;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.pine.common.beans.response.PageResponse;

import java.util.List;

/**
 * 分页工具
 *
 * @author pine manage
 * @since 2024-08-09
 */
public class PageUtil {

    /**
     * 分页结构转换
     */
    public static <T> PageResponse<T> convertPage(IPage<?> page, List<T> list) {
        return new PageResponse<>(list, (int) page.getTotal(), (int) page.getCurrent(), (int) page.getSize());
    }
}
